#ifndef ADDBLOCKTOPIECENETWORKEVENT_H_
#define ADDBLOCKTOPIECENETWORKEVENT_H_

#include "NetworkEvent.h"
#include "Position.h"

class AddBlockToPieceNetworkEvent : public NetworkEvent
{
public:
    struct Data
    {
        long pieceId;
        long blockId;
        int x;
        int y;
    };

    struct Message
    {
        Header header;
        Data data;
    };

    AddBlockToPieceNetworkEvent(long pieceId, long blockId, const Position& position);
    AddBlockToPieceNetworkEvent(const Header& header, const Data& data);
    virtual ~AddBlockToPieceNetworkEvent();

    virtual void visitPiece(Piece* piece) const;

    virtual void* getMessageBlob();
    virtual size_t getMessageBlobSize();

private:
    Message message;
};


#endif
